package fun.codefarmer.pm.service.Impl;

import fun.codefarmer.pm.mapper.RoleMapper;
import fun.codefarmer.pm.model.RespBean;
import fun.codefarmer.pm.model.Role;
import fun.codefarmer.pm.service.PermissService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ ClassName PermissServiceImpl
 * @ Descriotion TODO
 * @ author  codeFarmer_z
 * @ 公众号：码农教程
 * @ Date 2022/4/20 20:35
 **/
@Service
public class PermissServiceImpl implements PermissService {

    @Resource
    private RoleMapper roleMapper;
    @Override
    public RespBean getAllRole() {
        List<Role> listRole = roleMapper.getAllRole();
        if (listRole != null) {
            return RespBean.ok("", listRole);
        }
        return RespBean.error("查询失败");
    }
}
